//must be merged into object .h,then object's shapedesc can be eliminated
struct sse(vehicle)
{ssealloc
	float4x4 wheel[2];
	float4x4 camera;
	scene::entity_id enid;
	float maxpower;
	vehicle(object *o,float imaxpower,const float4a& pos_scale,const float4a&rotation);
	void addforce(float steer, float accel);
};
struct sse(wheel)
{ssealloc	

	float4a offset_radius;
	int flags;
	float suspensionfactor;
};
struct vehicle2;
struct waypoint
{
	float3	position;
	int		icon_id;
	float3	direction;
	float	radius;
	waypoint(vehicle2 *veh);
	//get the distance from vehicle
	float getdistance(vehicle2 * veh) const;
	bool is_wrong_way(vehicle2 * veh) const;
};
struct sse(vehicle2)
{ssealloc
	
	float4a bottomdirection;
	float4a rolldirection;
	float4a tangentdirection;
	float4a rollpointdir; 
	float maxpower;
	float tangentforce;
	float suspensionfactor;
	wheel *wheels;
	int numwheels;
	float mass;
	float damping;
	//int numsteerwheels;
	//int numdrivewheels;
	scene::entity_id enid;

	bool sliding;
	bool onground;
	int  gearid;
	vehicle2(object *o,const float4a& pos_scale,const float4a&rotation, float imaxpower = 7.f, float itangentaccelerate=200.f, float idamping=.000f);
	void addforce(float steer, float accel);

	int	 getgearid(){return gearid;}
	bool isonground(){return onground;}
	bool issliding(){return sliding;}
};